home *** CD-ROM | disk | FTP | other *** search
-
- ~4Dgifts/toolbox/src/exampleCode/irix/playEngine README
-
- This file describes the purpose and use of the
- functions defined in the source file PlayEngine.c.
-
- OVERVIEW:
- ---------
- The purpose of this source file is to provide a set of routines
- that will permit an audio track to be played without interference
- from operating system multitasking activities.
-
- The way it works is to sproc (similar to fork) a sub-process that
- raises its priority high enough so that the other operating system
- activities cannot preempt it. The main application provides this
- new process with a pointer to the data to be played and starts and
- stops the process through signals and/or semaphores.
-
- For more details on this implemetation, beyond what is contained in
- this README, see the comments throughout the PlayEngine.c file.
-
-
- DESCRIPTION:
- ------------
- This set of routines can be used for other purposes other than as
- an audio player but the demo program demonstrates the functions by
- playing audio tracks.
-
- Also, this demonstration program doesn't take full advantage of
- some of the capabilities of multiprocessing. For example, a flag
- could be provided in the audio loop that would allow the parent
- application to communicate commands to the child process, like to
- abort early, go back some number of records, etc.
-
- Entry points:
- -------------
- CreateSubProcess
- This routine is called once to create the subprocess. If
- semaphores are to be used, it will also create the semaphores.
-
- Synopsis:
- CreateSubProcess ();
-
-
- StartSubProcess
- This routine is called to tell the subprocess to do something.
- It must be preceded by a call to 'CreateSubProcess'. It is
- called each time the subprocess is to perform some task.
-
- Synopsis:
- StartSubProcess ();
-
-
- DestroySubProcess
- This routine destroys the subprocess and returns the semaphore
- arena to the system. It *must* be called otherwise, the
- semaphore arena is not returned to the system.
-
- Synopsis:
- DestroySubProcess ();
-
-
- COMPILATION:
- ------------
- There are two symbols of interest when compiling the PlayEngine.
- One is USE_SEMAPHORES, which will compile in code to use
- semaphores between the parent and child, and the other is
- DEBUG_SP, which compiles in debug print statements to allow the
- developer to see what is going on as it happens.
-
-
- Parts of the demo.c program were cut and pasted from the program
- ~4Dgifts/examples/libaudio/playaifc.c.
-